package staticProxy;

import java.sql.SQLOutput;

/**
 * @Author Yenchingcheng
 * @Date 2023/6/13 19:04
 * @Description 静态代理类
 **/
public class ProxyAnimal implements IAnimal {

    private IAnimal iAnimal;

    public ProxyAnimal(IAnimal animal){
        this.iAnimal = animal;
    }

    @Override
    public void eat() {
        System.out.println("Animal hunting...");
        iAnimal.eat();
        System.out.println("Animal嘴替吃掉了animal捕捉的猎物。");
    }
}
